package com.hzsk.lisence.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "software_license")
public class SoftwareLicenseEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column()
    private Integer id;

    @Column(name = "software_id",columnDefinition = "Integer(11) DEFAULT NULL comment '软件id'")
    private Integer softwareId;

    @Column(name = "user_id",columnDefinition = "Integer(11) DEFAULT NULL comment '客户id'")
    private Integer userId;

    @Column(name = "software_son_ids",  columnDefinition = "varchar(255) default '' comment '软件子模块id，多个以逗号隔开'")
    private String softwareSonIds;


    @Column(name = "hardware_key", columnDefinition = "varchar(255)  DEFAULT NULL  comment '硬件信息，多个以逗号隔开'")
    private String hardwareKey;

    @Column(name = "connection_limit", columnDefinition = "Integer(11) DEFAULT NULL  comment '连接数量限制'")
    private Integer connectionLimit;


    @Column(name = "license_describe",  columnDefinition = "varchar(255) default '' comment '许可描述'")
    private String licenseDescribe;



    @Column(name ="start_time",columnDefinition = "datetime DEFAULT NULL  comment '开始时间'")
    private String startTime;


    @Column(name ="end_time",columnDefinition = "datetime DEFAULT NULL  comment '结束时间'")
    private String endTime;


    @Column(name = "operator_user_id",columnDefinition = "Integer(11) DEFAULT NULL comment '发布则id'")
    private Integer operatorUserId;


    @Column(name = "flag",columnDefinition = "Integer(11) DEFAULT NULL comment '标识 0为正常、1为禁用'")
    @ApiModelProperty(value = "标识 0为正常、1为禁用")
    @JsonIgnore
    private Integer flag;

    @Column(name ="update_time")
    @ApiModelProperty(value = "修改时间")
    @JsonIgnore
    private Timestamp updateTime;


    @Column(name ="create_time",columnDefinition = "datetime DEFAULT NULL  comment '创建时间'")
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @Column(name = "confirm_flag",columnDefinition = "Integer(11) DEFAULT NULL comment '是否确认发布'")
    private Integer confirmFlag;

    @Transient
    private String userName;

    @Transient
    private List<SoftwareSonEntity> softwareSons;
}
